package com.pronosticnews.client.util;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.HTML;
import com.pronosticnews.shared.model.ClubDto;

public class ClubWidget extends HTML {

	private ClubDto club;

	public ClubWidget(ClubDto club) {

		this.club = club;

		if (club.getLogo() != null) {
			setHTML("<img src=" + GWT.getHostPageBaseURL() + "image/?id="
					+ club.getLogo() + "&width=" + 20
					+ " style='vertical-align:middle;margin-right: 5px;'>"
					+ club.getNom());

		} else {
			setHTML(club.getNom());
		}
	}

	public ClubDto getClub() {
		return club;
	}

	public void setClub(ClubDto club) {
		this.club = club;
	}

}
